from time import sleep

from app_ui.base.base_page import BaseHandle
from app_ui.page.对象层 import DemoPage



class DemoHandle(BaseHandle):
    """操作层"""

    def __init__(self):
        self.demo_page = DemoPage()

    def click_home_page(self):
        self.demo_page.find_home_page()

    def click_login(self):
        self.demo_page.find_login()

    def click_mobile_login(self):
        self.demo_page.find_mobile_login()

    def click_other_login(self):
        self.demo_page.find_other_login()

    def click_user_agreement(self):
        self.demo_page.find_user_agreement()

    def input_account(self, keyword):
        self.input(self.demo_page.find_account(), keyword)

    def input_user_password(self, keyword):
        self.input(self.demo_page.find_password(), keyword)

    def click_confirm_login(self):
        self.demo_page.find_confirm_login()

    def click_search(self):
        self.demo_page.find_search()

    def input_query_input(self, keyword):
        self.input(self.demo_page.find_query_input(), keyword)

    def click_select_user(self):
        self.demo_page.find_select_user()

    def click_perform_search(self):
        self.demo_page.find_perform_search()

    def click_i_home(self):
        self.demo_page.find_i_home()

    def click_i_guan_zhu(self):
        self.demo_page.find_i_guan_zhu()
        sleep(3)
        self.demo_page.getScreenShot()

    def click_i_zhi_bo(self):
        self.demo_page.find_i_zhi_bo()

    def click_z_srk(self):
        self.demo_page.find_z_srk()

    def input_z_ssrr(self, keyword):
        self.input(self.demo_page.find_z_ssrr(), keyword)

    def click_z_fs(self):
        self.demo_page.find_z_fs()

